<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="../../../../src/css/common/reset.css">
    <link rel="stylesheet" href="quill.snow.css">
    <script src="../../src/lib/jquery.js"></script>
    <script src="quill.min.js"></script>
</head>
<body>
    <div id="editor-container"></div>
</body>
<script>
    var p = null;
    $(function(){
        const quillConfig = [
            [{ header: [1, 2,3,4, false] }],
            ['bold', 'italic', 'underline'],
            ['image', /*'code-block'*/],
            ['coupon'],
            ['spread']
        ];
        p.quill = new Quill('#editor-container', {
            modules: {
                toolbar:quillConfig,
                //imageDrop: true,
            },
            placeholder: 'Compose an epic...',
            theme: 'snow'  // or 'bubble'
        });


        //动态生成按钮后操作
        function initQuill(){
            var couponObj = $('.ql-coupon');
            var spreadObj = $(".ql-spread");
            couponObj.addClass('iconfont icon-youhuiquan');
            spreadObj.addClass('iconfont icon-lianjie');
            //优惠券生成
            couponObj.on('click',function(){
                isUseCoupon();
            }).prop('title','Create Discount Code');
            //差价链接
            spreadObj.on('click',function(){
                spread();
            }).prop('title','Difference Price Link');
        }
        //();


        var content = p.quill.container.firstChild.innerHTML;
        var len = p.quill.getLength();
    })
</script>
</html>